package com.jqb.hibernatebbs.service.impl;

import java.util.List;

import com.jqb.hibernatebbs.pojo.Bbsmsg;
import com.jqb.hibernatebbs.service.MessageService;
import com.jqb.hibernatebbs.util.SessionLazyHandler;

public class MessageServiceImpl extends CommonServiceImpl implements MessageService {
	
	@SuppressWarnings("unchecked")
	public List<Bbsmsg> getMessages(){
		List<Bbsmsg> list = null;
		String hql = "from Bbsmsg";
		list = (List<Bbsmsg>) SessionLazyHandler.hqlQuery(hql, null);
		return list;
	}
	
	@SuppressWarnings("unchecked")
	public List<Bbsmsg> getPagingMessages(int pageSize,int pageNum){
		List<Bbsmsg> list = null;
		String hql = "from Bbsmsg";
		list = (List<Bbsmsg>) SessionLazyHandler.hqlPagingQuery(hql, null, pageSize, pageNum);
		return list;
	}

}
